//------------------------------------------------------------------------------
//  nguislider2_cmds.cc
//  (C) 2003 RadonLabs GmbH
//------------------------------------------------------------------------------
#include "gui/nguislider2.h"

static void n_setmaxvalue(void* slf, nCmd* cmd);
static void n_getmaxvalue(void* slf, nCmd* cmd);
static void n_movebottom(void* slf, nCmd* cmd);
//-----------------------------------------------------------------------------
/**
    @scriptclass
    nguislider2

    @cppclass
    nGuiSlider2

    @superclass
    nguiformlayout

    @classinfo
    A vertical slider
*/
void
n_initcmds(nClass* cl)
{
    cl->BeginCmds();
    cl->AddCmd("v_setmaxvalue_f",    'SMAX', n_setmaxvalue);
    cl->AddCmd("f_getmaxvalue_v",    'GMAX', n_getmaxvalue);
    cl->AddCmd("v_movebottom_v",     'MBOT', n_movebottom);
    cl->EndCmds();
}
//-----------------------------------------------------------------------------
/**
    @cmd
    setmaxvalue
    @input
    f
    @output
    v
    @info
    Sets the slider's maximum value.
*/
static void
n_setmaxvalue(void* slf, nCmd* cmd)
{
    nGuiSlider2* self = (nGuiSlider2*) slf;
    self->SetMaxValue(cmd->In()->GetF());
}
//-----------------------------------------------------------------------------
/**
    @cmd
    getmaxvalue
    @input
    v
    @output
    f
    @info
    Gets the slider's maximum value.
*/
static void
n_getmaxvalue(void* slf, nCmd* cmd)
{
    nGuiSlider2* self = (nGuiSlider2*) slf;
    cmd->Out()->SetF(self->GetMaxValue());
}

//-----------------------------------------------------------------------------
/**
    @cmd
    movebottom
    @input
    v
    @output
    v
    @info
    Moves the slider to the bottom.
*/
static void
n_movebottom(void* slf, nCmd* cmd)
{
    nGuiSlider2* self = (nGuiSlider2*) slf;
		self->MoveBottom();
}
